#该类中存放执行js的方法
from common.basedriver import BaseDriver
from pom.train_Buy_page import TrainBuyPage

class ExecuteJS(BaseDriver):

    def __init__(self):
        self.train_buy_page=TrainBuyPage()

    #去掉日期的readonly属性
    def depart_date_readonly(self):
        self.driver.execute_script('arguments[0].removeAttribute(\"readonly\")',self.train_buy_page.depart_date())
        self.train_buy_page.clear()
        self.train_buy_page().send_keys("2020-09-27")